<?php
class TradeItemVo extends SzAbstractMySqlVo
{

    private $userId;
    private $position;
    private $state;
    private $times;
    private $shelfTime;
    private $buyShelf;
    private $price;
    private $shareTimes;
    private $itemId;
    private $num;
    private $createTime;
    private $updateTime;

    /**
     * Initialize TradeItemVo.
     *
     * @param $userId
     * @param $position
     * @param $state
     * @param $times
     * @param $shelfTime
     * @param $buyShelf
     * @param $price
     * @param $shareTimes
     * @param $itemId
     * @param $num
     * @param $createTime
     * @param $updateTime
     * @param boolean $isInsert default false, means for now this vo is initialized not for insert process
     * @return TradeItemVo
     */
    public function __construct($userId, $position, $state, $times, $shelfTime, $buyShelf, $price, $shareTimes, $itemId, $num, $createTime, $updateTime, $isInsert = false) {
        $this->userId = $userId;
        $this->position = $position;
        $this->state = $state;
        $this->times = $times;
        $this->shelfTime = $shelfTime;
        $this->buyShelf = $buyShelf;
        $this->price = $price;
        $this->shareTimes = $shareTimes;
        $this->itemId = $itemId;
        $this->num = $num;
        $this->createTime = $createTime;
        $this->updateTime = $updateTime;

        $this->isInsert = $isInsert;
        $this->voClassName = 'TradeItemVo';
        $this->ormName = 'TradeItem';
    }

    /**
     * @see SzAbstractVo::toArray
     */
    public function toArray($needEncode = false)
    {
        return array(
            'userId' => $this->getUserId(),
            'position' => $this->getPosition(),
            'state' => $this->getState(),
            'times' => $this->getTimes(),
            'shelfTime' => $this->getShelfTime(),
            'buyShelf' => $this->getBuyShelf(),
            'price' => $this->getPrice(),
            'shareTimes' => $this->getShareTimes(),
            'itemId' => $this->getItemId(),
            'num' => $this->getNum(),
            'createTime' => $this->getCreateTime(),
            'updateTime' => $this->getUpdateTime(),
        );
    }

    /**
     * @see SzAbstractVo::toEntireArray
     */
    public function toEntireArray($needEncode = false)
    {
        return array(
            'userId' => $this->getUserId(),
            'position' => $this->getPosition(),
            'state' => $this->getState(),
            'times' => $this->getTimes(),
            'shelfTime' => $this->getShelfTime(),
            'buyShelf' => $this->getBuyShelf(),
            'price' => $this->getPrice(),
            'shareTimes' => $this->getShareTimes(),
            'itemId' => $this->getItemId(),
            'num' => $this->getNum(),
            'createTime' => $this->getCreateTime(),
            'updateTime' => $this->getUpdateTime(),
        );
    }

    /**
     * @see SzAbstractVo::toPureArray
     */
    public function toPureArray()
    {
        return array(
            $this->getUserId(),
            $this->getPosition(),
            $this->getState(),
            $this->getTimes(),
            $this->getShelfTime(),
            $this->getBuyShelf(),
            $this->getPrice(),
            $this->getShareTimes(),
            $this->getItemId(),
            $this->getNum(),
            $this->getCreateTime(),
            $this->getUpdateTime(),
        );
    }

    public function getUserId()
    {
        return $this->userId;
    }

    public function setUserId($val)
    {
        $this->saveColumnStatus(0, $this->userId);
        $this->userId = $val;
    }

    public function getPosition()
    {
        return $this->position;
    }

    public function setPosition($val)
    {
        $this->saveColumnStatus(1, $this->position);
        $this->position = $val;
    }

    public function getState()
    {
        return $this->state;
    }

    public function setState($val)
    {
        $this->saveColumnStatus(2, $this->state);
        $this->state = $val;
    }

    public function getTimes()
    {
        return $this->times;
    }

    public function setTimes($val)
    {
        $this->saveColumnStatus(3, $this->times);
        $this->times = $val;
    }

    public function getShelfTime()
    {
        return $this->shelfTime;
    }

    public function setShelfTime($val)
    {
        $this->saveColumnStatus(4, $this->shelfTime);
        $this->shelfTime = $val;
    }

    public function getBuyShelf()
    {
        return $this->buyShelf;
    }

    public function setBuyShelf($val)
    {
        $this->saveColumnStatus(5, $this->buyShelf);
        $this->buyShelf = $val;
    }

    public function getPrice()
    {
        return $this->price;
    }

    public function setPrice($val)
    {
        $this->saveColumnStatus(6, $this->price);
        $this->price = $val;
    }

    public function getShareTimes()
    {
        return $this->shareTimes;
    }

    public function setShareTimes($val)
    {
        $this->saveColumnStatus(7, $this->shareTimes);
        $this->shareTimes = $val;
    }

    public function getItemId()
    {
        return $this->itemId;
    }

    public function setItemId($val)
    {
        $this->saveColumnStatus(8, $this->itemId);
        $this->itemId = $val;
    }

    public function getNum()
    {
        return $this->num;
    }

    public function setNum($val)
    {
        $this->saveColumnStatus(9, $this->num);
        $this->num = $val;
    }

    public function getCreateTime()
    {
        return $this->createTime;
    }

    public function setCreateTime($val)
    {
        $this->saveColumnStatus(10, $this->createTime);
        $this->createTime = $val;
    }

    public function getUpdateTime()
    {
        return $this->updateTime;
    }

    public function setUpdateTime($val)
    {
        $this->saveColumnStatus(11, $this->updateTime);
        $this->updateTime = $val;
    }

}